perm filename NOTES[TEX,ALS]2 blob
sn#586678 filedate 1981-05-18 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00013 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00003 00002 Bugs fixed since 1-APR-1981
C00010 00003 May 12 1981 ALS Hack to save PASCAL core image:
C00013 00004 Dump of program PRETEX
C00015 00005 PASCAL TEX:
C00018 00006 RULES TO PREPARE A NEW SET OF DISTRIBUTABLE PASCAL SOURCES:
C00021 00007 The TEX distribution log is maintained under <tex.distrib>tex.distrib
C00022 00008 Start of a do file for ptex.
C00023 00009 To run PTEX with DDT for debugging:
C00026 00010 To obtain sample of font characters
C00027 00011 To determine font characteristics
C00028 00012 TEXSEM.STEX,DEK] table of contents
C00031 00013
C00033 ENDMK
C⊗;
Bugs fixed since 1-APR-1981
∂05-Apr-81 1935 DEK
To: DRF at SU-AI, IAZ at SU-AI, zippel at MIT-MC,
ramshaw at PARC-MAXC, scherlis at CMU-10A
OK gang, here is really the last change until 1990:
TEXSEM.SAI page 15 line 359 (a typo introduced a few weeks ago)
WRONG: begin shiftup←shiftup+delta; shiftdown←shiftdown+delta;
RIGHT: begin shiftup←shiftup+delta; shiftdown←shiftdown-delta;
[DONE]
∂18-Apr-81 1214 DEK
To: DRF at SU-AI, IAZ at SU-AI, MFP at SU-AI,
ramshaw at PARC-MAXC, zippel at MIT-MC, scherlis at CMU-10A
While looking at the SAIL code today I noticed a bug that has never been
tweaked in three years of TEX usage: Suppose one says
\leaders\hrule height 1pt depth 1pt \vfill
for example, in vertical mode, or
\leaders\vrule width 3pt \hfill
in horizontal mode. The manual is a bit vague, but if taken literally it
says that these height and depth and width specs are redundant. The code,
however, first tries to take account of them and then erroneously tries
to output the rule as if it were a box!
The following lines of code correct the bug, I think; I haven't bothered
to compile a new TEX with this fix, since nobody seems to mind the
existing version.
**** File 1) TEXDVI.OLD[TEX,DEK]/6P/46L
1) if type(b) NEQ rulenode or
1) (height(b)>-100000.0 and depth(b)>-100000.0) then
1) begin hh←height(b)+depth(b); if hh<0 then hh←0;
**** File 2) TEXDVI.SAI[TEX,DEK]/6P/46L
2) if type(b) NEQ rulenode then
2) begin hh←height(b)+depth(b); if hh<0 then hh←0;
***************
[DONE]
**** File 1) TEXDVI.OLD[TEX,DEK]/6P/132L
1) ww←width(b); if (ww<0) and (type(b) NEQ rulenode) then ww←0;
1) if ww NEQ 0 and type(link(q))=gluenode then
**** File 2) TEXDVI.SAI[TEX,DEK]/6P/131L
2) if type(b) NEQ rulenode then
2) begin ww←width(b); if ww<0 then ww←0;
2) end
2) else ww←-1.0;
2) if ww NEQ 0 and type(link(q))=gluenode then
***************
[DONE]
∂29-Apr-81 1409 DEK
To: ramshaw at PARC-MAXC, DRF at SU-AI, IAZ at SU-AI,
scherlis at CMU-10A, zippel at MIT-MC, MFP at SU-AI
A change to the line-breaking routine (saves memory and gives less weird
output in weird cases):
TEXSEM page 13 line 255
OLD: else if badness=infty then continue;
NEW: else if badness>threshold then continue;
[DONE]
6-may-81 In searching for bug with sub-subscripts, as reported by XXX, IAZ
and I found and fixed an error having to do with the assignment of widths
to math characters, where a reference to mathfonttable had been
inadvertently omitted. This was fixed.
6-may-81
Working alone, I searched for similiar ommissions with respect to shifts
and I found and fixed two such locations, namely:
In TEX.DOC in TEX.PAS
page 36 line 925 6136
36 950 6169
Sub-subscripts, sub-superscripts, super-superscripts, and super-subscripts now
seem to be positioned correctly.
6-May-81 16:08
mail for IAZ Another bug found.
I made a thorough search as you suggested and found one other bug, to wit:
Line 1265 in TEX.DOC
was
size:=maximum(1.8*h,2*h-xheight(fontsize[style])); {{ take care of large parenthesis }}
I changed it to
size:=maximum(1.8*h,2*h-xheight(mathfonttable(fontsize[style]
+mathsy))); {{ take care of large parenthesis }}
Line 1265 in TEX.PAS
was
SIZE:=MAXIMUM(1.8*H,2*H-FMEM[PARBASE[FONTSIZE[STYLE]]+4].PTS);
I changed it to
SIZE:=MAXIMUM(1.8*H,2*H-FMEM[PARBASE[EQTB[FONTSIZE[STYLE]+2+1393].INT]+4].PTS);
A comparison line shows that this change is probably correct.
T:=FMEM[PARBASE[EQTB[FONTSIZE[STYLE]+2+1393].INT]+21].PTS;
May 18th
At DEK's suggestion, the postemble code that lists selected fonts now lists
only those fonts that are actually used. This is done by having an array
FONTSUSED that is initiallized to zero and the appropiate entry is set to
one every time that a character is sent to the DVI file. At postemble
time this array is then referenced and used to select fonts that are to be
listed. Fonts declared but not used are, of course, referenced by PTEX
but DVIPRE and the printer are not bothered by their presence. This
will relieve the DOVER, in particular, of the necessity of wasting memory
space on unused fonts.
May 12 1981 ALS Hack to save PASCAL core image:
To produce a new dump file for PTEX with preloaded tables:
1) Change switches in SYSDEP to:
(*$R75,s8000,x11,T-,E+,G+,D-,O-,Y+*)
2) Fix TEX.PAS as follows:
a) Change switches to:
(*$R80,s8000,x11,T-,G+,D-,O-,Y+*)
b) Add new var.
initializing: integer;
c) Introduce some new code starting at line circa 11106,
where lower case lines are insertions and uppercase shows existing code.
BEGIN;
INITMEM;
INITTABLES;
initializing:=65;
writeln(tty,'Hit <call> key, then type REENTER<cr>'); break(tty);
while initializing=65 do begin end;
(*Extra instructions are needed to allow for variations in call point*)
pausingonerrors:=true;
pausingonerrors:=true;
pausingonerrors:=true;
pausingonerrors:=true;
pausingonerrors:=true;
PAUSINGONERRORS:=TRUE;
*********
3) Now do the following:
Compile tex.pas and sysdep.pas separately.
Load ptexld[tex,sys],tex,sysdep
C 200
ST
Program will type:
TO CONTINUE, HIT THE RETURN KEY *
Do it!
After a delay, program will type:
HIT <CALL> KEY, THEN TYPE REENTER<CR>
Do it!
Program will type:
Now type SS PTEX.DMP<cr> to save the core image.
Halt at user 171
Ignore the Halt message and
Do it!
The program is saved!
To test PTEX without saving it, type ST<CR>
The program will type:
*
You are on your own!
***********
A transcript of an actual session follows:
.load pretex,tex,sysdep
Swapping to SYS:LOADER.DMP
LOADING
LOADER 182+62 PAGES
Exit
↑C
.c 200
.st
TO CONTINUE, HIT THE RETURN KEY *
HIT <CALL> KEY, THEN TYPE REENTER<CR>
↑C
↑C
.reenter
Now type SS PTEX.DMP<cr> to save the core image.
Halt at user 171
↑C
.ss ptex
Job saved in 200+62 pages
↑C
.ru ptex
*
Dump of program PRETEX
124/ 0 160 ;The reentry address
LOC 124
START
RELOC
DCHKAC: BLOCK 20
160/ 202740 157 START: MOVEM 17,DCHKAC+17 ;Save registers
161/ 201740 140 MOVEI 17,DCHKAC
162/ 251740 156 BLT 17,DCHKAC+16
163/ 550740 130 HRRZ 17,130 ;Get old restart address
164/ 271740 4 ADDI 17,4 ;To get out of loop
165/ 542740 175 HRRM 17,NEWST2 ;Continuing address
166/ 201740 172 MOVEI 17,NEWST ;New starting address
167/ 542740 120 HRRM 17,120 ;New starting address
170/ 51140 202 OUTSTR [ASCIZ/Now type ...etc/]
171/ 254200 171 HALT.
172/ 51140 176 NEWST: OUTSTR [ASCIZ/This is ....etc/]
173/ 205740 157 MOVSI 17,DCHKAC+17 ;Restore registers
174/ 251740 17 BLT 17,17
175/ 254000 175 NEWST2: JRST . ;Address set by 165 above
176/ 523215 171500 ASCIZ /This is PTEX./
177/ 647464 50250
200/ 426605 606424
201/ 0 0
202/ 473376 720350 ASCIZ /Now type SS PTEX.DMP<cr>
to save the core image./
203/ 747414 520246
204/ 515012 52212
205/ 541350 446640
206/ 363076 237100
207/ 723364 71702
210/ 733124 72320
211/ 625014 367744
212/ 625015 166702
213/ 637125 606424
214/ 0 0 .
END
PASCAL TEX:
(May 9) The whole system consists of:
TEX.PAS the main program,
TEXPRE.PAS the generator of TEXINI.TBL
SYSDEP.PAS the system dependent routines
TEXINI.TBL the table of initial contents of tables
STRINI.TBL the list of strings printable by the current module
TEXPRE runs independently of TEX, but uses the same SYSDEP module. TEXPRE
accesses STRINI.TBL and expects to find its own error messages there. Thus
two different string tables should be maintained: one for TEXPRE and
another for TEX which should be given the name STRINI.TBL when needed.
(June 5) For IBM:
- Check the LONG.LNS file to modify those lines of the source
that exceed 72 characters.
(June 29) TEXDOC does not take the compiler directives:
In SYSDEP:
(*$R75,s8000,x11,T+,E+,G+,D-,O-,Y+*) {{ Compiler directives for the
PDP-10 PASCAL compiler}}
The corresponding line in TEX.DOC: (first line of page 3)
(*$R80,s8000,x11,T+,G+,D+,O-,Y-*) {{ Compiler options. }}
and in TEXPRE.DOC:
(*$R80,s8000,x11,T+,G+,D-,O-,Y-*) {{ Compiler options }}
initializing:=65; (* 65.='101 easy to recognize in DDT *)
if initializing<>0 then writeln(tty,'Save TEX'); break(tty); (* surprisingly
enough, this works *)
while initializing=65 do begin end;
As far as the laws of mathematics refer to reality they are not certain.
As far as the laws of mathematics are certain they don't refer to reality.
Albert Einstein
RULES TO PREPARE A NEW SET OF DISTRIBUTABLE PASCAL SOURCES:
(The TEXDOC and UNDOC programs we talk about here are those in [tex,iaz])
-Take away the comments and compiler directives in page 2, line 1 of TEX.DOC:
(same for TEXPRE)
-Run TEXDOC on TEX.DOC to check errors
(* \TEX\ {\:c STANFORD CS FEB 1981.}
\TEX\ was designed by Donald E. Knuth, who initially implemented it in \&{SAIL}.
This \&{PASCAL} version of \TEX\ is due to Ignacio A. Zabala. *)
(*$R80,s8000,x11,T+,G+,D+,O-,Y-*)
(* TEX STANFORD CS FEB 1981.
TEX was designed by Donald E. Knuth,
who initially implemented it in SAIL.
This PASCAL version of TEX
is due to Ignacio A. Zabala. *)
(*$R80,s8000,x11,T-,G-,D-,O-,Y+*)
-Take away the comments and compiler directives in SYSDEP.DOC page 2 line 9
(* \TEX\ {\:c STANFORD CS FEB 1981.}
\TEX\ was designed by Donald E. Knuth, who initially implemented it in \&{SAIL}.
This \&{PASCAL} version of \TEX\ is due to Ignacio A. Zabala. *)
(*$R75,s8000,x11,T+,E+,G+,D+,O-,Y-*)
(* TEX STANFORD CS FEB 1981.
TEX was designed by Donald E. Knuth,
who initially implemented it in SAIL.
This PASCAL version of TEX
is due to Ignacio A. Zabala. *)
(*$R75,s8000,x11,T-,E+,G-,D-,O-,Y+*)
-Run TEXDOC on SYSDEP to check errors
-Run UNDOC on SYSDEP (but put strings in SYSDEP.STR[tex,iaz] just in case
something fails).
-Run FORMAT on SYSDEP.PAS to get SYSDEP.POS
-Put comments and compiler directives back into SYSDEP
-Run PFORM on SYSDEP.POS
-Compile SYSDEP.
- At the end. After everything appears correct, the last step is to
run FORMAT and all three .pas files once more to get them in the right format,
and to run TEXDOC on them to obtain listings if desired.
The TEX distribution log is maintained under <tex.distrib>tex.distrib
Start of a do file for ptex.
access tex,iaz↔
TEX↔
FTP SCORE↔
ascii↔
user csd.zabala↔
pindonga↔
XCWD <TEX.PASCAL>↔
get tex.pas↔
get texpre.pas↔
get sysdep.pas↔
bye↔|
compile sysdep↔
compile texpre↔
load sysdep,texpre↔
c 200↔
st↔|
al TEX,SYS↔
COP STRINI.TBL←SYSDEP.STR,TEX.STR↔
compile sysdep,pas[tex,iaz]↔
compile tex,pas[tex,iaz]↔
load tex.sysdep↔
c 200↔
r tftopl↔
cmr10↔
er carm10.pl↔|
To run PTEX with DDT for debugging:
1) Change switches to read:
in tex.pas
(*$R80,s8000,x11,T+,G+,D+,O-,Y+*)
in sysdep.pas
(*$R75,s8000,x11,T+,E+,G+,D+,O-,Y+*)
2) Delete special loading-hack instructions from TEX
3) Change line at approx. 28 on p 1 in SYSDEP.PAS, now reading:
CONST TERDEVICE='TTY ';
to;
CONST TERDEVICE='TER ';
4) Compile TEX.PAS and SYSDEP.PAS separately, for safety.
5) Now type:
load/ddt TEX,SYSDEP<cr>
then
c 200<cr>
then
Get another channel
<ESC><CALL>, type pt and note number #
<BREAK> R to go back and type assign tty# ter<cr>
now debugger will report on original channel
and new channel is used for commands
st<cr>
type file name<cr>
stop ? set desired stop
end<cr> tell program to run until stopped or to end
at stop type i<cr> then \chpar0←'77777777<cr>
at any stop location to read any cell number #, type #=<cr>
To read mem location type mem[#]twoword.byte2=
or mem[#].fourbyte.byte1=
or mem[#].pts
At end of session deassign the extra channel by typing DEA<cr> on the normal
channel, then BREAK R to get to the assigned channel and then hit CALL.
To obtain sample of font characters
R TEX
\input sample.tex[can,ltp]
at stop type
i<cr>
then cmathx {}<cr>
or the name of some other font
<cr> to print.
To determine font characteristics
R TFtoPL
\input cmathx.mft
Creates a file CMATHX.PL for example
TEXSEM.STEX,DEK] table of contents
COMMENT ⊗ VALID 00019 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00004 00002 entry begin comment The semantics module of TEX.
C00008 00003 Data structures for boxes.
C00027 00004 Displaying and destroying boxes: dumpnodelist,dsnodelist,tracedump,boxcopy
C00037 00005 The semantic stacks: mode,head,curnode,aux,spacefactor,prevdepth,incompleat
C00044 00006 The page builder.
C00054 00007 Introduction to math formula processing and data structures for mlists.
C00076 00008 Maintaining the semantic stacks: pushnest,popnest,decodemode,dumpactivities
C00080 00009 Font information. (New specifications due to Lyle Ramshaw, November 1980.)
C00116 00010 Making lists into boxes: nullbox,hpackage,vpackage,hpack,vpack
C00130 00011 Spacing and adding to the current list: initsftable,append,finishdisplay
C00141 00012 Hyphenation (word division) routines.
C00160 00013 The paragraph builder: hangwidth,hangbegin,justification,finishparagraph
C00201 00014 Procedures for mmode: finishmlist,boxchar,compact,mathglue,varsymbol,
C00218 00015 Major math mode procedures: mlist_to_hlist,evalmlist,boxfield
C00253 00016 Data structures for \halign and \valign: alignlist,alignrecord
C00260 00017 Alignment procedures: (init|end)align,(start|finish)(alignbox|unsetnode)
C00275 00018 Beginning of the main procedure: maincontrol
C00322 00019 Ending of the main procedure
C00348 ENDMK
C⊗;